﻿using System.Windows.Media;
using jSLCore.Client.Presentation.BaseControl;

namespace jSLApp.Client.Forms
{
    public partial class ImageDialog : DialogControl
    {
        private readonly ImageSource _imageSource;

        public ImageDialog(ImageSource imageSource):this()
        {
            _imageSource = imageSource;
        }

        public ImageDialog()
        {
            InitializeComponent();
            image.MouseLeftButtonUp += (sender, args) => InvokeCancelSelected();
            MouseLeftButtonUp += (o, eventArgs) => InvokeCancelSelected();
        }

        public override bool IsStandartOkCancelEnabled
        {
            get { return false; }
        }

        protected override void AcceptButtonClicked()
        {
            InvokeCancelSelected();
        }

        public override void LoadInitialData()
        {
            image.Source = _imageSource;
        }
    }
}
